package data.structure;

import java.util.ArrayList;
import java.util.List;

public class Test {

    public static void main(String[] args) {
        Queue queue = new Queue();
        queue.addQue(5);
        queue.addQue(3);
        if (!queue.isEmpty()) {
            System.out.println(queue.front());
        }
        queue.delQue();
        if (!queue.isEmpty()) {
            System.out.println(queue.front());
        }
        queue.delQue();


    }
}


class Queue{

    private List<Integer> data;
    private Integer p_start;

    public Queue(){
        data = new ArrayList<>();
        p_start = 0;
    }

    public boolean addQue(Integer x) {
        data.add(x);
        return true;
    }

    public boolean isEmpty() {
        if (p_start >= data.size()) {
            return true;
        }
        return false;
    }

    public Integer front(){
        if (isEmpty()) {
            return null;
        }
        return data.get(p_start);
    }

    public boolean delQue() {
        if (isEmpty()) {
            return false;
        }
        p_start++;
        return true;
    }
}
